﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AlertSystem.Web
{
    public partial class AccessDenied : BasePage
    {
        protected override void OnInit(EventArgs e)
        {
            if (RequiredLogin())
            {
                if (Session.IsNewSession)
                    Session.Timeout = 60;
                ReturnURL = Request.RawUrl;
                RedirectToPage(LoginURL);
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (HasRole())
                {
                    RedirectToPage(DefaultURL);
                }
            }
        }
    }
}